home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR10 / TGE129C.ZIP / SOURCE / TGEDEMO.CPP < prev    next >
C/C++ Source or Header  |  1993-08-20  |  18KB  |  707 lines

  1. /*****************************************************************************
  2. *       The Graphics Engine version 1.29ßC                                   *
  3. *                                                                            *
  4. *       The Graphics Engine code and documentation are Copyright (c) 1993    *
  5. *       by Matthew Hildebrand.                                               *
  6. *                                                                            *
  7. *       Unauthorised usage or modification of any or all of The Graphics     *
  8. *       Engine is strictly prohibited.                                       *
  9. *****************************************************************************/
  10.  
  11. #include <alloc.h>
  12. #include <conio.h>
  13. #include <dir.h>
  14. #include <dos.h>
  15. #include <process.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <time.h>
  20. #include "tgemouse.h"
  21. #include "tgefont.h"
  22. #include "tge.h"
  23.  
  24.  
  25. #ifndef __TURBOC__
  26.   #define random(num)        (rand() % num)
  27.   #define randomize()          srand((unsigned)time(NULL))
  28. #endif
  29.  
  30. #define ESC    27
  31.  
  32.  
  33. void setup(int argc, char *argv[]);
  34. void lineDemo(void);
  35. void putPixelDemo(void);
  36. void drawRectDemo(void);
  37. void filledRectDemo(void);
  38. void ellipseDemo(void);
  39. void filledEllipseDemo(void);
  40. void circleDemo(void);
  41. void filledCircleDemo(void);
  42. void viewportDemo(void);
  43. void setupViewport(void);
  44. void viewportPutImageDemo(int delayTime);
  45. void viewportRandomDemo(void);
  46. void scaleBitmapDemo(void);
  47. void paletteDemo(void);
  48. void mouseDemo(void);
  49. void cycleColour(int *colour, int *increment);
  50. void forceExtension(char *filename, char *extension);
  51. void signOff(void);
  52. //void showScreen(void);
  53. void quitIfEsc(void);
  54.  
  55.  
  56. unsigned char tgeLogo[] = {
  57.   24,0,9,0,
  58.   0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,
  59.   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  60.   0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,
  61.   0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,
  62.   0,0,1,1,0,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,0,0,0,
  63.   0,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,1,1,1,1,0,0,0,0,
  64.   0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,
  65.   0,1,1,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,
  66.   1,1,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0
  67. };
  68. #define LOGOWIDE    ((unsigned*)tgeLogo)[0]
  69. #define LOGODEEP    ((unsigned*)tgeLogo)[1]
  70.  
  71.  
  72. Font font("8x16.fnt");
  73. int count, colour;
  74. void far *bground, *screen;
  75.  
  76.  
  77. //*****
  78. //***** Program entry
  79. //*****
  80.  
  81. void main(int argc, char *argv[])
  82. {
  83.   //*** Set things up
  84.   setup(argc, argv);
  85.  
  86.   //*** Run the demos
  87.   lineDemo();
  88.   putPixelDemo();
  89.   drawRectDemo();
  90.   filledRectDemo();
  91.   ellipseDemo();
  92.   filledEllipseDemo();
  93.   circleDemo();
  94.   filledCircleDemo();
  95.   viewportDemo();
  96.   scaleBitmapDemo();
  97.   paletteDemo();
  98.   mouseDemo();
  99.  
  100.   deInitGraphics();            // restore text and quit
  101. //  farfree(screen);
  102. }
  103.  
  104.  
  105. //*****
  106. //***** Set up at program start
  107. //*****
  108.  
  109. void setup(int argc, char *argv[])
  110. {
  111.   char filename[80];
  112.  
  113.   //*** Parse command line
  114.   if (argc < 2)
  115.   {
  116.     printf("TGEDEMO 1.29ßC  Copyright (c) 1993 by Matthew Hildebrand\n\n"
  117.        "          Usage:  TGEDEMO driver\n\n"
  118.        "       Examples:  tgedemo 640x480\n"
  119.        "                  tgedemo ..\\320x200.drv\n"
  120.        "                  tgedemo e:\\tge\\360x480\n\n");
  121.     exit(1);
  122.   }
  123.  
  124.   //*** Ensure font loaded correctly
  125.   if (!font.status())
  126.   {
  127.     printf("Error loading 8X16.FNT\n\n");
  128.     exit(1);
  129.   }
  130.  
  131.   //*** Load the graphics driver
  132.   strcpy(filename, argv[1]);
  133.   forceExtension(filename, ".DRV");
  134.   if (loadGraphDriver(filename) != TGE_SUCCESS)
  135.   {
  136.     printf("Error loading \"%s\".\n\n", filename);
  137.     exit(1);
  138.   }
  139.   else
  140.     atexit(unloadGraphDriver);
  141.  
  142.   //*** Allocate some temporary memory
  143.   bground = farmalloc(imageSize(0,0,23,8));
  144.  
  145.   //*** Initialize graphics mode
  146.   if (!initGraphics())
  147.   {
  148.     printf("Unable to initialize graphics hardware.\n\n");
  149.     exit(1);
  150.   }
  151.  
  152.   //*** Set font foreground colour
  153.   font.foreground(colourCloseToX(255,255,255,0));
  154.  
  155.   //*** Create a virtual screen
  156. //  screen = makeVirtScreen(OUTMAXX+1, OUTMAXY+1);
  157. //  if (screen == NULL)
  158. //  {
  159. //    deInitGraphics();
  160. //    printf("Not enough memory to hold virtual screen.\n\n");
  161. //    exit(1);
  162. //  }
  163. //  setGraphicsAddr(screen);
  164. //  clearGraphics(0);
  165.  
  166.   //*** Seed the random number generator
  167.   randomize();
  168.  
  169.   //*** Set up atexit() queue
  170.   atexit(signOff);                // sign-off screen
  171. }
  172.  
  173.  
  174. //*****
  175. //***** line() demo
  176. //*****
  177.  
  178. void lineDemo(void)
  179. {
  180.   static char str[] = "TGE supports many functions.";
  181.   int depth = font.deep(str);
  182.  
  183.   font.put((OUTMAXX+1)/2-font.wide(str)/2, OUTMAXY-depth, str);
  184.  
  185.   for (; !kbhit();)
  186.     line(random(OUTMAXX+1), random(OUTMAXY-depth), random(OUTMAXX+1),
  187.     random(OUTMAXY-depth), random(MAXCOLOUR));
  188.  
  189.   quitIfEsc();
  190.  
  191.   colour = random(MAXCOLOUR);
  192.   for (count=OUTMAXX; count>=0&&!kbhit(); count-=2)
  193.   {
  194.     line(0, 0, OUTMAXX-count, OUTMAXY, colour);
  195.     line(OUTMAXX, OUTMAXY, count, 0, colour);
  196.   }
  197.  
  198.   if (kbhit())
  199.     quitIfEsc();
  200.   clearGraphics(random(MAXCOLOUR));
  201. }
  202.  
  203.  
  204. //*****
  205. //***** putPixel() demo
  206. //*****
  207.  
  208. void putPixelDemo(void)
  209. {
  210.   for (; !kbhit();)
  211.   {
  212.     for (count=0; count<2000; count++)
  213.       putPixel(random(OUTMAXX+1), random(OUTMAXY+1), random(MAXCOLOUR));
  214.   }
  215.  
  216.   quitIfEsc();
  217.   clearGraphics(random(MAXCOLOUR));
  218. }
  219.  
  220.  
  221. //*****
  222. //***** drawRect() demo
  223. //*****
  224.  
  225. void drawRectDemo(void)
  226. {
  227.   while (!kbhit())
  228.     drawRect(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX+1),
  229.         random(OUTMAXY+1), random(MAXCOLOUR));
  230.  
  231.   quitIfEsc();
  232.   clearGraphics(random(MAXCOLOUR));
  233. }
  234.  
  235.  
  236. //*****
  237. //***** filledRect() demo
  238. //*****
  239.  
  240. void filledRectDemo(void)
  241. {
  242.   while (!kbhit())
  243.     filledRect(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX+1),
  244.         random(OUTMAXY+1), random(MAXCOLOUR));
  245.  
  246.   quitIfEsc();
  247.   clearGraphics(random(MAXCOLOUR));
  248. }
  249.  
  250.  
  251. //*****
  252. //***** ellipse() demo
  253. //*****
  254.  
  255. void ellipseDemo(void)
  256. {
  257.   while (!kbhit())
  258.     ellipse(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/8)*2+10,
  259.         random(OUTMAXY/8)*2+10, random(MAXCOLOUR));
  260.  
  261.   quitIfEsc();
  262.   clearGraphics(random(MAXCOLOUR));
  263. }
  264.  
  265.  
  266. //*****
  267. //***** filledEllipse() demo
  268. //*****
  269.  
  270. void filledEllipseDemo(void)
  271. {
  272.   while (!kbhit())
  273.     filledEllipse(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/8)*2+10,
  274.     random(OUTMAXY/8)*2+10, random(MAXCOLOUR));
  275.  
  276.   quitIfEsc();
  277.   clearGraphics(random(MAXCOLOUR));
  278. }
  279.  
  280.  
  281. //*****
  282. //***** circle() demo
  283. //*****
  284.  
  285. void circleDemo(void)
  286. {
  287.   while (!kbhit())
  288.     circle(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/8)+10,
  289.         random(MAXCOLOUR));
  290.  
  291.   quitIfEsc();
  292.   clearGraphics(random(MAXCOLOUR));
  293. }
  294.  
  295.  
  296. //*****
  297. //***** filledCircle() demo
  298. //*****
  299.  
  300. void filledCircleDemo(void)
  301. {
  302.   while (!kbhit())
  303.     filledCircle(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/8)+10,
  304.         random(MAXCOLOUR));
  305.  
  306.   quitIfEsc();
  307.   clearGraphics(0);
  308. }
  309.  
  310.  
  311. //*****
  312. //***** Viewport demo
  313. //*****
  314.  
  315. void viewportDemo(void)
  316. {
  317.   int x1, y1, x2, y2;
  318.   static char str1[] = "Viewports can be very useful.";
  319.   static char str2[] = "(Now that it's slower, the";
  320.   static char str3[] = "image's features can be seen.)";
  321.   static char str4[] = "Many functions work with viewports,";
  322.   static char str5[] = "and at considerable speeds.";
  323.  
  324.   x1 = 2 * (OUTMAXX+1)/5;
  325.   y1 = 2 * (OUTMAXY+1)/5;
  326.   x2 = OUTMAXX - x1;
  327.   y2 = OUTMAXY - y1;
  328.  
  329.   setupViewport();
  330.   font.put((OUTMAXX+1)/2-font.wide(str1)/2, (OUTMAXY+1)/10, str1);
  331.   setViewports(x1, y1, x2, y2);
  332.   viewportPutImageDemo(0);
  333.  
  334.   setupViewport();
  335.   font.put((OUTMAXX+1)/2-font.wide(str2)/2, (OUTMAXY+1)/10, str2);
  336.   font.put((OUTMAXX+1)/2-font.wide(str3)/2, (OUTMAXY+1)/10+font.deep(str1),
  337.     str3);
  338.   setViewports(x1, y1, x2, y2);
  339.   viewportPutImageDemo(12);
  340.   setViewports(0, 0, OUTMAXX, OUTMAXY);
  341.  
  342.   x1 = (OUTMAXX+1)/5;            // make a larger viewport
  343.   y1 = (OUTMAXY+1)/5;
  344.   x2 = OUTMAXX - x1;
  345.   y2 = OUTMAXY - y1;
  346.   clearGraphics(colourCloseTo(90,90,90));
  347.   filledRect(x1, y1, x2, y2, colourCloseTo(0,0,0));
  348.   font.put((OUTMAXX+1)/2-font.wide(str4)/2, (OUTMAXY+1)/30, str4);
  349.   font.put((OUTMAXX+1)/2-font.wide(str5)/2, (OUTMAXY+1)/30+font.deep(str4), str5);
  350.   setViewports(x1, y1, x2, y2);
  351.   viewportRandomDemo();
  352.  
  353.   setViewports(0, 0, OUTMAXX, OUTMAXY);        // restore the viewport
  354.   clearGraphics(colourCloseTo(0,0,0));
  355. }
  356.  
  357.  
  358. //*****
  359. //***** Set up the viewport
  360. //*****
  361.  
  362. void setupViewport(void)
  363. {
  364.   int x1, y1, x2, y2;
  365.  
  366.   x1 = 2 * (OUTMAXX+1)/5;
  367.   y1 = 2 * (OUTMAXY+1)/5;
  368.   x2 = OUTMAXX - x1;
  369.   y2 = OUTMAXY - y1;
  370.  
  371.   clearGraphics(colourCloseTo(90,90,90));
  372.   filledRect(x1, y1, x2, y2, colourCloseTo(0,0,0));
  373.   setViewports(x1, y1, x2, y2);                  // set viewport
  374.  
  375.   // center
  376.   putImage((x2+x1+1)/2-LOGOWIDE/2, (y2+y1+1)/2-LOGODEEP/2, tgeLogo);
  377.   // upper left
  378.   putImage(x1-LOGOWIDE/2, y1-LOGODEEP/2, tgeLogo);
  379.   // upper middle
  380.   putImage(((x2+x1+1)/2)-LOGOWIDE/2, y1-LOGODEEP/2, tgeLogo);
  381.   // upper right
  382.   putImage(x2-LOGOWIDE/2, y1-LOGODEEP/2, tgeLogo);
  383.   // middle right
  384.   putImage(x2-LOGOWIDE/2, (y2+y1+1)/2-LOGODEEP/2, tgeLogo);
  385.   // lower right
  386.   putImage(x2-LOGOWIDE/2, y2-LOGODEEP/2, tgeLogo);
  387.   // lower middle
  388.   putImage((x2+x1+1)/2-LOGOWIDE/2, y2-LOGODEEP/2, tgeLogo);
  389.   // lower left
  390.   putImage(x1-LOGOWIDE/2, y2-LOGODEEP/2, tgeLogo);
  391.   // middle left
  392.   putImage(x1-LOGOWIDE/2, (y2+y1+1)/2-LOGODEEP/2, tgeLogo);
  393.  
  394.   setViewports(0, 0, OUTMAXX, OUTMAXY);
  395. }
  396.  
  397.  
  398. //*****
  399. //***** Viewport and putImage() demo
  400. //*****
  401.  
  402. void viewportPutImageDemo(int delayTime)
  403. {
  404.   int x, y;
  405.  
  406.   // moving putImageInv() demo (clipped)
  407.   x = (OUTMAXX+1)/2 - LOGOWIDE/2;
  408.   y = (OUTMAXY+1)/2 - LOGODEEP/2;
  409.  
  410.   while (!kbhit())
  411.   {
  412.     getImage(x, y, x+LOGOWIDE-1, y+LOGODEEP-1, bground);
  413.     putImageInv(x, y, tgeLogo);
  414.     if (delayTime)
  415.       delay(delayTime);
  416.     putImage(x>=VIEWPORTULX?x:VIEWPORTULX, y>=VIEWPORTULY?y:VIEWPORTULY,
  417.     bground);
  418.  
  419.     if (random(201) > 100)
  420.       x = x<VIEWPORTLRX+LOGOWIDE/2 ? x+1 : x-1;
  421.     else
  422.       x = x>VIEWPORTULX-LOGOWIDE/2 ? x-1 : x+1;
  423.  
  424.     if (random(201) > 100)
  425.       y = y<VIEWPORTLRY+LOGODEEP/2 ? y+1 : y-1;
  426.     else
  427.       y = y>VIEWPORTULY-LOGODEEP/2 ? y-1 : y+1;
  428.   }
  429.  
  430.   quitIfEsc();
  431. }
  432.  
  433.  
  434. //*****
  435. //***** A bit of everything in a viewport
  436. //*****
  437.  
  438. void viewportRandomDemo(void)
  439. {
  440.   int type;
  441.   int x1, y1, x2, y2;
  442.  
  443.   while (!kbhit())
  444.   {
  445.     type = random(8);
  446.     switch (type)
  447.     {
  448.       case 0:                // line()
  449.     x1 = random(OUTMAXX+1);
  450.     y1 = random(OUTMAXY+1);
  451.     x2 = random(OUTMAXX+1);
  452.     y2 = random(OUTMAXY+1);
  453.     if (clipLine(&x1, &y1, &x2, &y2))
  454.       line(x1, y1, x2, y2, random(MAXCOLOUR));
  455.     break;
  456.       case 1:                // ellipse()
  457.     ellipse(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/3),
  458.         random(OUTMAXY/3),    random(MAXCOLOUR));
  459.     break;
  460.       case 2:                // filledEllipse();
  461.     filledEllipse(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/3),
  462.         random(OUTMAXY/3), random(MAXCOLOUR));
  463.     break;
  464.       case 3:                // circle()
  465.     circle(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/3),
  466.         random(MAXCOLOUR));
  467.     break;
  468.       case 4:                // filledCircle()
  469.     filledCircle(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX/3),
  470.         random(MAXCOLOUR));
  471.     break;
  472.       case 5:                // putImageInv()
  473.     putImageInv(random(OUTMAXX+1), random(OUTMAXY+1), tgeLogo);
  474.     break;
  475.       case 6:                // filledRect()
  476.     x1 = random(OUTMAXX+1);
  477.     y1 = random(OUTMAXY+1);
  478.     x2 = random(OUTMAXX+1);
  479.     y2 = random(OUTMAXY+1);
  480.     if (clipFilledRect(&x1, &y1, &x2, &y2))
  481.       filledRect(x1, y1, x2, y2, random(MAXCOLOUR));
  482.     break;
  483.       case 7:
  484.     drawRect(random(OUTMAXX+1), random(OUTMAXY+1), random(OUTMAXX+1),
  485.         random(OUTMAXY+1), random(MAXCOLOUR));
  486.     break;
  487.       default:
  488.     ;
  489.     }
  490.   };
  491.  
  492.   quitIfEsc();
  493. }
  494.  
  495.  
  496. //*****
  497. //***** scaleBitmap() demo
  498. //*****
  499.  
  500. void scaleBitmapDemo(void)
  501. {
  502.   void far *image;
  503.   register unsigned count;
  504.  
  505.   //*** Grab a block of memory
  506.   image = farmalloc(imageSizeDim(200, 200));
  507.   if (image == NULL)
  508.     return;
  509.  
  510.   //*** Make image grow from center of screen
  511.   for (count=1; count<=200&&!kbhit(); count++)
  512.   {
  513.     scaleBitmap(tgeLogo, count, count, image);       // scale it
  514.     putImage((MAXX+1-count)/2, (MAXY+1-count)/2, image); // draw it
  515.   }
  516.  
  517.   //*** Release memory
  518. //  graphicsAddr(NULL);
  519.   farfree(image);
  520.  
  521.   quitIfEsc();
  522.   clearGraphics(0);
  523. }
  524.  
  525.  
  526. //*****
  527. //***** Palette demo
  528. //*****
  529.  
  530. #define MAXINC    7
  531.  
  532. void paletteDemo(void)
  533. {
  534.   int redInc, greenInc, blueInc;
  535.   int red=0, green=0, blue=0;
  536.   colour = 1;
  537.  
  538.   redInc = random(MAXINC);
  539.   redInc++;
  540.   greenInc = random(MAXINC);
  541.   greenInc++;
  542.   blueInc = random(MAXINC);
  543.   blueInc++;
  544.  
  545.   for (count=OUTMAXX; count>=0&&!kbhit(); count-=2) {
  546.     line(0, 0, OUTMAXX-count, OUTMAXY, colour);
  547.     line(OUTMAXX, OUTMAXY, count, 0, colour);
  548.     cycleColour(&red, &redInc);
  549.     cycleColour(&green, &greenInc);
  550.     cycleColour(&blue, &blueInc);
  551.     setPaletteReg(0, red, green, blue);
  552.   }
  553.  
  554.   if (kbhit())
  555.   {
  556.     quitIfEsc();
  557.   }
  558.  
  559.   setPaletteReg(0, 0, 0, 0);
  560.   clearGraphics(1);
  561. }
  562.  
  563. void cycleColour(int *colour, int *increment)
  564. {
  565.   *colour += *increment;
  566.  
  567.   if (*colour < 0)
  568.   {
  569.     *colour = 0;
  570.     *increment = random(MAXINC) + 1;
  571.   }
  572.   else if (*colour > 255)
  573.   {
  574.     *colour = 255;
  575.     *increment *= -1;
  576.   }
  577. }
  578.  
  579.  
  580. //*****
  581. //***** Mouse demo
  582. //*****
  583.  
  584. void mouseDemo(void)
  585. {
  586.   int pointerNum;
  587.  
  588.   if (!resetMouse())            // check if mouse is installed
  589.   {
  590.     deInitGraphics();
  591.     unloadGraphDriver();
  592.     printf("Microsoft or compatible mouse not detected.\n"
  593.        "The demo for definable, device-independent pointers will not be run.\n\n"
  594.        "Press a key to continue...");
  595.     getch();
  596.     clrscr();
  597.     signOff();
  598.     exit(0);
  599.   }
  600.  
  601.   initNewMouse();            // initialize new mouse handler
  602.   setHorizLimitsMouse(0, OUTMAXX);
  603.   setVertLimitsMouse(0, OUTMAXY);
  604.   setPosMouse(OUTMAXX/2, OUTMAXY/2);
  605.   pointerNum = BIG_ARROW_POINTER;
  606.   setupMousePointer(pointerNum);
  607.   showMouse();
  608.  
  609.   for (; !kbhit();)            // main loop
  610.   {
  611.     if (buttonMouse() && pointerNum!=BIG_TARGET_POINTER)
  612.     {
  613.       pointerNum = BIG_TARGET_POINTER;
  614.       hideMouse();
  615.       setupMousePointer(pointerNum);
  616.       showMouse();
  617.     }
  618.     else if (!buttonMouse() && pointerNum==BIG_TARGET_POINTER)
  619.     {
  620.       pointerNum = BIG_ARROW_POINTER;
  621.       hideMouse();
  622.       setupMousePointer(pointerNum);
  623.       showMouse();
  624.     }
  625.   }
  626.   getch();                // flush keyboard buffer
  627.  
  628.   deInitNewMouse();            // shut off new mouse handler
  629. }
  630.  
  631.  
  632. //*****
  633. //***** Miscellaneous routines
  634. //*****
  635.  
  636. void forceExtension(char *filename, char *extention)
  637. {
  638.   char fileDrive[MAXDRIVE];
  639.   char fileDir[MAXDIR];
  640.   char fileFile[MAXFILE];
  641.   char fileExt[MAXEXT];
  642.  
  643.   fnsplit(filename, fileDrive, fileDir, fileFile, fileExt);
  644.  
  645.   if (strcmpi(fileExt, extention))
  646.     fnmerge(filename, fileDrive, fileDir, fileFile, extention);
  647. }
  648.  
  649.  
  650. void signOff(void)
  651. {
  652.   static char notice[] = {
  653.     "┌──────────────────────────────────────────────────────────────────────────────┐"
  654.     "│ The Graphics Engine 1.29ßC Demo     Copyright (c) 1993 by Matthew Hildebrand │"
  655.     "╞══════════════════════════════════════════════════════════════════════════════╡"
  656.     "│ Although this demo is not particularly gripping, the power of TGE can be     │"
  657.     "│ seen when it uses different drivers:  the demo uses the same code to access  │"
  658.     "│ different graphics modes.  Even if you don't want device-independence, but   │"
  659.     "│ only one graphics mode, TGE's optimized assembler routines may be used.      │"
  660.     "│                                                                              │"
  661.     "│ TGE has many features, including:                                            │"
  662.     "│      ■ Use of loadable graphics drivers and loadable fonts                   │"
  663.     "│      ■ A powerful set of graphical functions                                 │"
  664.     "│      ■ Support for viewports, or clipping regions                            │"
  665.     "│      ■ Support for virtual screens of varying sizes                          │"
  666.     "│      ■ Extensive mouse support, including definable pointers                 │"
  667.     "│      ■ Graphics output using COPY, AND, NOT, OR, and XOR                     │"
  668.     "│      ■ A utility to convert PCX files to TGE-format images                   │"
  669.     "│                                                                              │"
  670.     "│ TGE costs non-commercial users a mere $30; paid users are entitled to free   │"
  671.     "│ upgrades, technical support, royalty-free distribution rights, and eternal   │"
  672.     "│ happiness.  Refer to TGE.DOC for details.                                    │"
  673.     "╞══════════════════════════════════════════════════════════════════════════════╡"
  674.     "│ Matthew Hildebrand, 4 College St., St. Catharines, Ontario, Canada, L2R 2W7  │"
  675.     "└──────────────────────────────────────────────────────────────────────────────┘"
  676.     "\nPress a key to continue..."
  677.   };
  678.  
  679.   printf(notice);
  680.  
  681.   getch();
  682.   clrscr();
  683.   printf("*** ATTENTION ***\n\n"
  684.      "This version of TGE (1.29ßC) is a PUBLIC BETA version.  It contains a\n"
  685.      "few known bugs, and is not yet entirely completed; for instance, TGEDEMO\n"
  686.      "currently does not reflect all of TGE's features.  TGE 1.30 will be\n"
  687.      "released when the problems in 1.29ßC have been rectified.  Until then,\n"
  688.      "TGE 1.29ßC should be reliable enough for most purposes.\n\n");
  689. }
  690.  
  691.  
  692. //void showScreen(void)
  693. //{
  694. //  setGraphicsAddr(NULL);
  695. //  putImage(0, 0, screen);
  696. //  setGraphicsAddr(screen);
  697. //}
  698.  
  699. void quitIfEsc(void)
  700. {
  701.   if (getch() == ESC)
  702.   {
  703.     deInitGraphics();
  704.     exit(0);
  705.   }
  706. //  showScreen();
  707. }